<!--
 * @Author: your name
 * @Date: 2020-12-08 13:32:28
 * @LastEditTime: 2021-05-19 19:12:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /medicine-web/src/App.vue
-->
<template>
  <a-config-provider :locale="locale">
    <div id="app" @click.stop="restoreTout">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import { LOGIN_TIME_OUT } from '@/utils/dict'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default  {
  name:  'App',
  data (){
    return {
      locale: zhCN,
      tOut: LOGIN_TIME_OUT  //超时时间15min
    } 
  },
  methods:{
    // tTime() {
    //   if (!this.getCookie('uid') || !this.getCookie('token')) {
    //     return
    //   }
    //   if (this.getLocalStorage('tOut') || this.getLocalStorage('tOut') == 0) {
    //     this.tOut = this.getLocalStorage('tOut')
    //   }
    //   this.tOut--
    //   console.log('this.tOut', this.tOut)
    //   this.setLocalStorage('tOut', this.tOut)
    //   if (this.getLocalStorage('tOut') == 0) {
    //     this.removeCookie('uid')
    //     this.removeCookie('token')
    //     this.$router.push('/login')
    //   }
    // }
    restoreTout () {
      this.setLocalStorage('tOut', this.tOut)
    }
  },
  mounted () {
    // window.setInterval(this.tTime, 1000)
  }
}
</script>
<style lang="scss">
.ant-checkbox-checked .ant-checkbox-inner {
  background: #3882BD !important;
}
</style>
